﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition;
using System.IO;
using SoundEdge.WinControls.Settings;
using SoundEdge.Media.Settings;
using SoundEdge.Media;

namespace SoundEdge.Dashboard
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new MainForm());

            var catalog = new AggregateCatalog();
            catalog.Catalogs.Add(new DirectoryCatalog(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly));
            catalog.Catalogs.Add(new AssemblyCatalog(typeof(IOutputSettings).Assembly));
            CompositionContainer container = new CompositionContainer(catalog);
            //container.ComposeParts(this);
            var mainForm = container.GetExportedValue<MainForm>();
            //container.ComposeParts(typeof(AudioPlayer));
            Application.Run(mainForm);
        }
    }
}
